package com.example.train_operate.controller;

import com.example.train_operate.entity.Examine;
import com.example.train_operate.service.CentralizedMaintenanceGuidelinesService;
import com.example.train_operate.util.Result;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@CrossOrigin
@Api(tags = "集中检修指导书接口")
@RequestMapping("/CentralizedMaintenanceGuidelines")
public class CentralizedMaintenanceGuidelinesController {
    @Autowired
    private CentralizedMaintenanceGuidelinesService centralizedMaintenanceGuidelinesService;
    @GetMapping("/getCentralizedMaintenanceGuidelines")
    public Result getCentralizedMaintenanceGuidelines(@RequestParam Integer step){
        return centralizedMaintenanceGuidelinesService.getCentralizedMaintenanceGuidelinesByStep( step);
    }
    @PostMapping("/addCentralizedMaintenanceGuidelines")
    public Result addCentralizedMaintenanceGuidelines(@RequestBody Examine examine){
        return centralizedMaintenanceGuidelinesService.addCentralizedMaintenanceGuidelines(examine);
    }
    @PutMapping("/updateCentralizedMaintenanceGuidelines")
    public Result updateCentralizedMaintenanceGuidelines(@RequestBody Examine examine){
        return centralizedMaintenanceGuidelinesService.updateCentralizedMaintenanceGuidelines(examine);
    }
    @DeleteMapping("/deleteCentralizedMaintenanceGuidelines")
    public Result deleteCentralizedMaintenanceGuidelines(@RequestParam Integer step){
        return centralizedMaintenanceGuidelinesService.deleteCentralizedMaintenanceGuidelines( step);
    }
    @GetMapping("/listDailyInspectionJudgment")
    public Result listCentralizedMaintenanceGuidelines(){
        return centralizedMaintenanceGuidelinesService.listCentralizedMaintenanceGuidelines();
    }
}
